package pikes.core;

import java.io.IOException;

import org.junit.Assert;
import org.junit.Test;

public class AbstractPrintableTestCase {

	@Test
	public void testToString() throws Exception {
		AbstractPrintable ap = new AbstractPrintable() {
			public void print(Appendable appendable) throws IOException {
				appendable.append("boo");

			}
		};
		Assert.assertEquals("boo", ap.toString());
	}

	@Test
	public void testToStringWithException() throws Exception {
		AbstractPrintable ap = new AbstractPrintable() {
			public void print(Appendable appendable) throws IOException {
				throw new IOException("Exception message");

			}
		};
		Assert.assertEquals("Exception message", ap.toString());
	}

}
